package taskshare.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.util.BeanUtil;

import taskshare.meta.TaskMeta;
import taskshare.model.Task;
import taskshare.service.TaskService;

public class EdittaskController extends Controller {

    TaskMeta meta = TaskMeta.get();

    TaskService taskService = new TaskService();

    @Override
    public Navigation run() throws Exception {

        Task task = taskService.get(asKey(meta.key));

        BeanUtil.copy(task, request);
        requestScope("task", task);

        return forward("edittask.jsp");
    }
}
